home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19960425-19960715 / 000016_news@columbia.edu _Sat Apr 27 12:06:56 1996.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: news@columbia.edu
  2. Received: from apakabar.cc.columbia.edu (apakabar.cc.columbia.edu [128.59.35.159]) by watsun.cc.columbia.edu (8.7.5/8.7.3) with ESMTP id MAA22009 for <kermit.misc@watsun>; Sat, 27 Apr 1996 12:06:56 -0400 (EDT)
  3. Received: (from news@localhost) by apakabar.cc.columbia.edu (8.7.5/8.7.3) id MAA11757 for kermit.misc@watsun; Sat, 27 Apr 1996 12:06:54 -0400 (EDT)
  4. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  5. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  6. Newsgroups: comp.protocols.kermit.misc
  7. Subject: Re: Terminal Emulation: cursor control via mouse
  8. Date: 27 Apr 1996 16:06:36 GMT
  9. Organization: Columbia University
  10. Lines: 37
  11. Message-ID: <4ltgmc$bfb@apakabar.cc.columbia.edu>
  12. References: <17775B3EAS86.AMRHEIN@VM.TEMPLE.EDU>
  13. NNTP-Posting-Host: watsun.cc.columbia.edu
  14.  
  15. In article <17775B3EAS86.AMRHEIN@VM.TEMPLE.EDU>,
  16. amrhein,paul <AMRHEIN@VM.TEMPLE.EDU> wrote:
  17. : I am currently incorporating the Kermit file transfer protocol into a
  18. : terminal emulation program used in an IBM mainframe environment.
  19. :  
  20. : I have encountered a problem (not related to file transfer) that has me
  21. : stumped.  I'd like to relocate the on-screen cursor with a click of the
  22. : mouse.  The algorithm goes roughly like this:
  23. :  
  24. :       determine the current cursor coordinates
  25. :       determine the coordinates of the mouse pointer when clicked
  26. :       compute the number of arrow strokes (up, down, left, right) needed to
  27. :               properly relocate the cursor
  28. :       send these keystrokes
  29. :  
  30. : When I implement this algorithm, the mouse click sends the cursor flying
  31. : about my screen in all directions (reminiscent of the old 'Pong' game), and
  32. : it comes to rest in an unlikely position.  We have come to call this effect
  33. : 'the rogue cursor.'
  34. :  
  35. How this sort of thing works depends on various factors.  First you should
  36. be aware that arrow keys send different sequences depending on the
  37. terminal type and what "mode" the cursor keypad is in.  The mode must
  38. agree with the mode that the host application thinks they are in to
  39. achieve the desired effect.
  40.  
  41. Second, the success of this technique depends on the screen management
  42. model of the host application: is the screen represented as a n x m
  43. rectangle filled with blanks all the way to the right margin, or is it
  44. represented as a series of lines of varying length?
  45.  
  46. The best way to make this technique work is to try it yourself, by hand,
  47. fingers on arrow keys, in many different situations, using many different
  48. techniques, until you find the one that misbehaves the least, and then
  49. program it that way.
  50.  
  51. - Frank